/**
	General class with handy static debug methods.

	@author Chandler McWilliams
	@version 2005-04-14
*/
class timber.util.Debug
{
	
/**
	Recursively prints contents of an object.
	If you only pass 1 arg, the title is supplied for you.

	@param  k name of the current object
	@param  mixed v the object to print
	@param  d depth of the recursion, used internally.
	@return () 
**/
	public static function print_r(k,v,d:Number) {
		if (d > 200) return; // avoid recursion errors 
		if (arguments.length == 1) {
			v = k;
			k = "print_r";
		}
		var i;
		var indent = '';
		for (i=0;i<d;i++) indent += ' ';
		if (typeof d == 'undefined') d = 0;
		if (v instanceof Array) {
			trace(indent + k + ' :: ');
			for (i=0; i<v.length; i++) timber.util.Debug.print_r(i,v[i], d+1);
		} else if (v instanceof Object) {
			trace(indent + k + ' :: ');
			for (i in v) timber.util.Debug.print_r(i,v[i], d+1);
		} else {
			trace(indent + k + ' :: ' + v);
		}
	}
	
}